package mvc
{
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.text.TextField;
	import flash.text.TextFieldAutoSize;

	public class DigitalClock extends AbstractClockView
	{
		private var _frame:Sprite;
		private var _display:TextField;
		public function DigitalClock(data:ClockData)
		{
			super(data);
			_frame = new Sprite;
			_frame.graphics.lineStyle(0,0x000000,1);
			_frame.graphics.drawRect(0,0,200,20);
			addChild(_frame);
			
			_display = new TextField;
			_display.width = 200;
			_display.height = 50;
			_display.autoSize = TextFieldAutoSize.RIGHT;
			_display.x = 195;
			_display.y= 5;
			addChild(_display);
			draw();
		}
		override protected function draw(event:Event=null):void{
			var time:Time = _data.time;
			_display.htmlText = "<font size='40'>" + time.hour + ":" + time.minute + ":" + time.second + "</font>";
		}
	}
}